
// https://zhuanlan.zhihu.com/p/99845040

const initialState = {
  counter: 0
}

export function oprCounter(state = initialState, action) {
  switch (action.type) {
    case "INCREMENT":
      return { counter: state.counter + 1 }
    case "DECREMENT":
      return { counter: state.counter - 1 }
    default:
      return state;
  }
}